﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>THẾ GIỚI LINH KIỆN MÁY TÍNH-XUÂN TUẤN</title>
<style>
a {text-decoration: none}
.style1 {	color: #0033FF;
	font-weight: bold;
	font-size: 36px;
}
</style>
</head>
<body background="../img/anhnen/Digital_composite_spring_1018.jpg">

<div align="center">
<table width="100%"  border=1 bordercolor="#339933" cellpadding=2 cellspacing=1>
  <tr align="center"> 
    <td  bgcolor="#009900"><font size="1">Mã SP</font></td>
    <td bgcolor="#009900"><font size="1">Tên SP</font></td>
    <td bgcolor="#009900"><font size="1">Loại SP</font></td>
	 <td bgcolor="#009900"><font size="1">Nhà cung cấp</font></td>
      <td bgcolor="#009900"><font size="1">Hình ảnh</font></td>
      <td  bgcolor="#009900"><font size="1">ĐVT</font></td>
      <td bgcolor="#009900"><font size="1">Số lượng</font></td>
    <td  bgcolor="#009900"><font size="1">Đơn giá</font></td>
	<td  bgcolor="#009900"><font size="1">Mô tả</font></td>
	  <td  bgcolor="#009900"><b><font size="1">Sửa</font></b></td>
    <td bgcolor="#009900"><b><font size="1">Xóa</font></b></td>
  </tr>

	   
<font size="+2"><b>Xem Sản Phẩm</b></font><hr>
	    

	    <input type="button" onclick="window.location='capnhatsanpham.php'" value="  Cập nhật Sản phẩm mới  " ><p>
	  
  <?php
	$url="../img/anhsp/";
	 $con=mysql_connect("localhost","root","");
	  mysql_select_db("linhkienmt",$con);
	  $sql="select * from sp,ncc,loaisp where sp.mancc=ncc.mancc and sp.maloai=loaisp.maloai order by masp";
	  $kq=mysql_query($sql,$con);
	while ($row=mysql_fetch_array($kq))
	{$hinh=$row['hinhanh'];
      	 echo "<tr >";
 	     echo "<td ><font size='1'>".$row['masp']."</font></td>";
  		 echo " <td><font size='1'>".$row['tensp']."</font></td>";
		  echo " <td><font size='1'>".$row['maloai']."</font></td>";
  		 echo  "<td><font size='1'>".$row['mancc']."</font></td>";
         echo "<td><font size='1'><img src='".$url.$hinh."'width='50' height='50'></font></td>";
	   	echo "<td><font size='1'>".$row['dvtinh']."</font></td>";
	     echo "<td><font size='1'>".$row['soluong']."</font></td>";
 	    echo "<td><font size='1'>  ".number_format($row['dongia'],3)."  VNĐ</font></td>"; 
		  echo "<td><font size='1'>".$row['mota']."</font></td>"; 
		?>
		<td ><font size="1"><a?masp=<?php echo $row['masp'];?>">Sửa</a></font></td>
		 <td><font size="1"><a href="xoasanpham.php?masp=<?php echo $row['masp']; ?>">Xóa</a></font></td>
		<?php
	  	echo "</tr>";
		}
		  mysql_close($con); ?>
      </table>
</div></body>
</html>
